//
//  HLSquareOptionRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/5/18.
//

#import "HLSquareOptionRequest.h"

@implementation HLSquareOptionRequest

{
    NSDictionary *_params;
    HLSquareOptionType _type;
}

- (id)initWithType:(HLSquareOptionType)type params:(NSDictionary *)params
{
    self = [super init];
    
    if (self) {
        _type = type;
        _params = params;
    }
    
    return self;
}

- (NSString *)requestUrl
{
    switch (_type) {
        case HLSquareOptionTypeDelete:
            return @"/platform_dynamic/delete";
            break;
        case HLSquareOptionTypeCommentDelete:
            return @"/platform_dynamic/delete_comment";
            break;
        case HLSquareOptionTypeLike:
            return @"/platform_dynamic/dynamic_like_unlike";
            break;
        case HLSquareOptionTypeComment:
            return @"/platform_dynamic/comment";
            break;
        case HLSquareOptionTypeNotice:
            return @"/platform_dynamic/interactive_ring";
            break;
        case HLSquareOptionTypeVideoAnalysis:
            return @"/platform_dynamic/video/analysis";
            break;
    }
}

- (YTKRequestMethod)requestMethod
{
    if ( _type == HLSquareOptionTypeNotice){
        return YTKRequestMethodGET;
    } else {
        return YTKRequestMethodPOST;
    }
}

- (id)requestArgument
{
    return _params;
}

@end
